package com.neusoft.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.neusoft.bean.PageBean;
import com.neusoft.mapper.RegisterMapper;
import com.neusoft.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class RegisterServiceImpl implements RegisterService {
    @Autowired
    private RegisterMapper registerMapper;
    @Override
    public PageBean searchPatientInformations(Integer page, Integer pageSize, String caseNumber, String realName) {
        PageHelper.startPage(page,pageSize);
        Page<Map<String,Object>> pageInfo=registerMapper.selectPatientByPages(caseNumber,realName);
        PageBean pageBean=new PageBean();
        pageBean.setRows(pageInfo.getResult());
        pageBean.setCount(pageInfo.getTotal());
        return pageBean;
    }
}
